<?php
if (!defined('ZAZA')) exit('No direct script access allowed');
/**
 * @copyright     ZaZa Group
 * @author        Sir Doan
 */

class AdminWebsiteAdd extends Form
{
    function __construct()
    {                          
        Form::__construct('AdminWebsiteAddForm'); 
        tpl()->layout = 'admin';  
    }  
    // Method Submit
    function is_submit()
    {
         $siteInfo = array( 'title' => Obj()->get('title'), 
                            'url' => Obj()->get('address_url'),
                            'dateline' => time());
         require_once MODEL_PATH . DS .'AdminWebsite_model.php';
         $objSite = new AdminWebsite_Model();
         $res = $objSite->add($siteInfo);
         if($res)
            Url::redirectUrl(Url::buildUrl(null, 'admin_site', true), true);
    }
    // Method Draw
    function draw()
    {              
        tpl()->assign('form', array('begin' => $this->begin(), 'end' => $this->end()));
        return tpl()->display('admin_siteadd'); 
    }
}  
?>
